<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>07 跨层级</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <child></child>

    </div>
</body>
<template id="child1">
    <div>
        <h3>孙组件</h3>

    </div>
</template>
<template id="child">
    <div>
        <h3>
            子组件
            <child1></child1>
        </h3>

    </div>
</template>
<script>
    let child2 = {
        template:"#child2",
    }


    let child = {
        template: "#child",
        components:{
            child2
        },

    }



    new Vue({
        el: "#app",
        data: {
            num: 100,
        },
        components: {
            child
        },
    })



</script>

</html>